<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
    <head>
        <title></title>
        <meta charset="utf-8">
        <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
        <link rel="stylesheet" href="css/fonts/font-awesome.min.css">
        <link rel="stylesheet" href="css/ui-box.css">
        <link rel="stylesheet" href="css/ui-base.css">
        <link rel="stylesheet" href="css/ui-color.css">
        <link rel="stylesheet" href="css/appcan.icon.css">
        <link rel="stylesheet" href="css/appcan.control.css">
        <style type="text/css">
            .imgs_1{
                filter:Glow(Color="#6699CC",Strength="5");height:2em;width:100%;background: url(image/cxy_3.png)no-repeat 0 0;background-size: 1.5em;background-position: center;;
            }
            .imgs_2{
                height:2em;width:100%;background: url(image/cxy_4.png)no-repeat 0 0;background-size: 1.5em;background-position: center;
            }
            #triangle-up {
                width: 0;
                height: 0;
                border-left: .5em solid transparent;
                border-right: .5em solid transparent;
                border-bottom: .8em solid #fff;;
                margin-left: 4.4em;
            }
        </style>
    </head>
    <body class="um-vp" ontouchstart style="background: #202a33;">
        <div id="" style="width:31%;position: absolute;z-index: 100;height:2em;line-height: 2em;top:1em;left:1em;;">
            <div id="code" style="color:#fff;width:100%;border:1px solid rgba(8, 202, 201,1);font-size: .9em;border-radius: .3em;padding-left: 1em;background: url(image/cxy_7.png)no-repeat 0 0;background-position: 90% center;background-size: 1.3em;">上海虹桥</div>
            <select id="sel" style="height:2em;width:110%;z-index: 1101;opacity: 0;position: absolute;top:0;left:0;">
                <option>上海虹桥</option>
                <option>上海浦东</option>
            </select>
        </div>
        <div id="" class="" style="width:31%;height:2em;line-height: 2em;position: absolute;top:3.5em;color:#fff;z-index: 100;border-bottom: solid 1px #ccc;margin-left: 1em;text-align: center;padding-left: .5em;padding-right: .5em;">
           <div id="" class="ub">
                   <div id="" style="">
                        当前任务：
                   </div>
                   <div id="now_rw" style="color:rgba(8, 202, 201,1)">
                       登机
                   </div>
           </div>
           
        </div>
        <div id="timeList" style="width:6em;position: absolute;z-index: 100;right: 0;color: #000;text-align: center;font-size: .9em;display: none;">
            <div id="triangle-up">
                
            </div>
            <div id="" style="width:80%;border-radius: .4em;background: #fff;padding: 0 10%;">
                <div id="data1" style="width:100%;height:2.5em;line-height: 2.5em;" onclick="shuaxin(this.id)">
                    日统计
                </div>
                <div id="data2" style="width:100%;height:2.5em;line-height: 2.5em;border-bottom:1px solid #ccc;border-top:1px solid #ccc;" onclick="shuaxin(this.id)">
                    周统计
                </div>
                <div id="data3" style="width:100%;height:2.5em;line-height: 2.5em;" onclick="shuaxin(this.id)">
                    月统计
                </div>
            </div>
            
        </div>
        <div id="big1" style="height:100%;display: ;background: #202a33;">
              <div id="main1" style="width: 100%;height:80%;color:#fff;text-align: center;padding:10% 0;"></div>
        </div>
        <div id="" style="width:90%;margin :1em auto;border-radius: .4em;border:2px solid #08cac9;color:#fff;">
            <div id="" style="width:100%;text-align:center;height:2.5em;line-height: 2.5em;border-bottom: 1px solid #08cac9;" class="ub">
                <div id="" style="width:49.5%;border-right:  1px solid #08cac9;">
                    任务
                </div>
                <div id="" style="width:49.5%;;">
                    平均用时
                </div>
            </div>
            <div id="adds" style="width:100%;text-align:center;border-bottom: 1px solid #08cac9;" class="ub">
                <!--div id="" style="width:49.5%;text-align:center;height:2.5em;line-height: 2.5em;" class="ub">
                    <div id="" style="width:100%;border-right:  1px solid #08cac9;">
                        装机
                    </div>
                </div>
                 <div id="" style="width:49.5%;text-align:center;height:2.5em;line-height: 2.5em;border-bottom: 1px solid #08cac9;" class="ub">
                    <div id="" style="width:100%;">
                        11.11
                    </div>
                </div-->
            </div>
        </div>
        <div id="big2" style="height:80%; ">
            <div id="" style="height:10%;">
                
            </div>
              <div id="main2" style="width: 98%;height:85%;margin:0 auto;;"></div>
        </div>
        <div id="big3" style="height:100%;">
             <div id="" style="height:10%;">
                
            </div>
              <div id="main3" style="width: 95%;height:130%;margin:0 auto;"></div>
        </div>
    </body>
    <script src="js/appcan.js"></script>
    <script src="js/appcan.control.js"></script>
    <script src="js/jquery-3.1.1.min.js"></script>
    <script src="js/echarts.min.js"></script>
    <script src="js/common.js"></script>
    <script src="js/highcharts.js"></script>
     <script src="js/talkingdata.js"></script>
    </body>
    <script>
      var oDate = new Date();
      var toyer  = String(oDate.getFullYear());   
      var tomos  = String(oDate.getMonth()+1);
      var today  = String(oDate.getDate()); 
       tomos = tomos < 10 ? ('0' + tomos) : tomos; 
       today = today < 10 ? ('0' + today) : today; 
      var CreateDate=toyer+"-"+tomos+"-"+today;
      var CreateDate1=toyer+"-"+tomos+"-01";
      var datemos=toyer+"年"+tomos+"月";
      console.log(datemos);
      var t_url="http://172.31.3.190:8080/";//测试
      var resultDate = new Array();
        var dateTaskType = "登机";
        var dateTaskScore;
        var weekTaskType = "登机";
        var weekTaskScore;
        var monthTaskType = "登机";
        var monthTaskScore;
        var text_size="15";
        var isAnd;
        var android = window.navigator.userAgent.indexOf('Android');
        if(android>0){
             var IH = window.innerWidth || document.documentElement.clientWidth || document.body.scrollWidth;
             if(IH==""||IH==undefined||IH=="undefined"||IH==0){
                            IH=362;
                        }
             text_size=(1088/Number(IH)*5)+"px";
             isAnd=130;
        }else{
             text_size="15";
             isAnd=130;
        }
        appcan.ready(function() {
            appcan.window.openToast("正在加载,请稍等...",-1,5,1);
            getVisualTaskQuality(CreateDate1,CreateDate,datemos,'登机');
            localStorage.setItem("yddf_yxpz_time","3");
             //rewu('登机');
             getVisualTask('登机')
            $("#top").hide();
             IC.talkingDataCount("运行品质","0208");  
        });
           $("#sel").on("change",sel);
           function sel(){
                IC.talkingDataCount("运行品质","0208");  
               var vals=$("#sel").val();
               $("#code").text(vals);
               var data1=GetDateStr(-7);
               console.log(data1)
               var id= localStorage.getItem("yddf_yxpz_time");
              console.log(data1);
              if(id=="1"){
                  var dataName=CreateDate.replace(/\-/g,"/");
                  getVisualTaskQuality(CreateDate,CreateDate,dataName);
                  localStorage.setItem("yddf_yxpz_time","1");
              }else if(id=="2"){
                   var dataName=data1.replace(/\-/g,"/")+"-"+CreateDate.replace(/\-/g,"/");
                  getVisualTaskQuality(data1,CreateDate,dataName);
                  localStorage.setItem("yddf_yxpz_time","2");
              }else if(id=="3"){
                   var dataName=datemos;
                  getVisualTaskQuality(CreateDate1,CreateDate,dataName);
                  localStorage.setItem("yddf_yxpz_time","3");
              }
           }
           var myChart1 = echarts.init(document.getElementById('main1'));
           var myChart2 = echarts.init(document.getElementById('main2'));
           var myChart3 = echarts.init(document.getElementById('main3'));
            
            function toTop(){
                var n=1;
                for(i=0;i<4;i++){
                    if($("#no_"+i).attr("class")=="imgs_1"){
                        n=i;
                    }
                }
                if(n==1){
                    $("#no_1").attr("class","imgs_2");
                    $("#no_2").attr("class","imgs_1");
                    $("#no_3").attr("class","imgs_2");
                    $("#big1").hide();
                    $("#big2").show();
                    $("#big3").hide();
                    $("#top").show();
                }else if(n==2){
                     $("#no_1").attr("class","imgs_2");
                     $("#no_3").attr("class","imgs_1");
                     $("#no_2").attr("class","imgs_2");
                     $("#big1").hide();
                    $("#big2").hide();
                    $("#big3").show()
                     $("#top").show();
                     $("#bottom").hide();
                }else{
                    return;
                }
            }
            function toBottom(){
                var n=1;
                for(i=0;i<4;i++){
                    if($("#no_"+i).attr("class")=="imgs_1"){
                        n=i;
                    }
                }
                if(n==2){
                    $("#no_1").attr("class","imgs_1");
                    $("#no_2").attr("class","imgs_2");
                    $("#no_3").attr("class","imgs_2");
                    $("#big1").show();
                    $("#big2").hide();
                    $("#big3").hide()
                    $("#top").hide();
                }else if(n==3){
                     $("#no_1").attr("class","imgs_2");
                     $("#no_2").attr("class","imgs_1");
                     $("#no_3").attr("class","imgs_2");
                     $("#big1").hide();
                     $("#big2").show();
                     $("#big3").hide()
                     $("#top").show();
                     $("#bottom").show();
                }else{
                    return;
                }
            }
             function GetSlideAngle(dx, dy) {  
              return Math.atan2(dy, dx) * 180 / Math.PI;  
          }  
   
          //根据起点和终点返回方向 1：向上，2：向下，3：向左，4：向右,0：未滑动  
         /* function GetSlideDirection(startX, startY, endX, endY) {  
              var dy = startY - endY;  
              var dx = endX - startX;  
              var result = 0;  
   
              //如果滑动距离太短  
              if(Math.abs(dx) < 2 && Math.abs(dy) < 2) {  
                  return result;  
              }  
   
              var angle = GetSlideAngle(dx, dy);  
              if(angle >= -45 && angle < 45) {  
                  result = 4;  
              }else if (angle >= 45 && angle < 135) {  
                  result = 1;  
              }else if (angle >= -135 && angle < -45) {  
                  result = 2;  
              }  
              else if ((angle >= 135 && angle <= 180) || (angle >= -180 && angle < -135)) {  
                  result = 3;  
              }  
              return result;  
          }  
          var startX, startY;  
          document.addEventListener('touchstart',function (ev) {  
              startX = ev.touches[0].pageX;  
              startY = ev.touches[0].pageY;    
          }, false);  
          document.addEventListener('touchend',function (ev) {  
              var endX, endY;  
              endX = ev.changedTouches[0].pageX;  
              endY = ev.changedTouches[0].pageY;  
              var direction = GetSlideDirection(startX, startY, endX, endY);  
              switch(direction) {  
                  case 0:  
                     // alert("没滑动");  
                      break;  
                  case 1:  
                      toTop()
                      break;  
                  case 2:  
                       toBottom();  
                      break;  
                  case 3:  
                      //alert("向左");  
                      //alert("!");  
                      break;  
                  case 4:  
                     // alert("向右");  
                      break;  
                  default:             
              }  
          }, false);  */
          var optionArr=[];
          var keyArr=[];
          function getVisualTaskQuality(data1,data2,title,names){
                IC.talkingDataCount("运行品质","0208");  
              console.log(title)
              var code=$("#code").html();
              if(code=="上海虹桥"){
                  code="SHA";
              }else{
                  code="PVG";
              }
             
              var airport=code;
              title=code+" "+title+" 任务监控打分";
              optionArr=[];
              keyArr=[];
              //var url="http://127.0.0.1:8080/yddfMAS/h_getVisualTaskQuality?periodStart="+data1+"&periodEnd="+data2+"&siteName="+airport;
              var url=t_url+"mpservice/yxpz_getVisualTaskQuality.action?periodStart="+data1+"&periodEnd="+data2+"&siteName="+airport;
              console.log(url)
              $.ajax({
                  url:url,
                  type:"GET",
                  dataType:"text",
                  success:function(data){
                       appcan.window.closeToast();
                      console.log(data);
                     // data=JSON.parse(data);
                      //var fat=data.getVisualTaskQualityResult;
                         // var quality=eval("("+fat+")");
                         data=eval("("+data+")");
                         //console.log(data);
                          var AVGDATA=data.table1;
                          console.log(AVGDATA);
                          var anshi=0;
                          var yanwu=0
                           var keyArr = new Array();
                            for (var i = 0; i < data.table1.length; i++) {
                                keyArr.push(data.table1[i].PPCNAME);
                                if(names==data.table1[i].PPCNAME){
                                    anshi=Number(data.table1[i].AVGDATA);
                                    yanwu=100-anshi;
                                    hatchChart_1(anshi,yanwu,names);
                                    rewu(names)
                                }
                            }
                            
                            //获取任务节点分数值
                            var optionArr = new Array();
                            for (var i = 0; i < data.table1.length; i++) {
                                optionArr.push(parseFloat(data.table1[i].AVGDATA));
                            }
                        
                            var taskindex = keyArr.indexOf(dateTaskType)
                            dateTaskScore = optionArr[taskindex];
                            console.log(dateTaskScore);
                         // console.log(JSON.stringify(quality.table1));
                         var option1 = {
                               title: {
                                text: '',
                                textStyle: {
                                    color: '#fff',
                                    fontSize:text_size
                                }
                            },
                            tooltip: {
                                formatter: function (params, ticket, callback) {
                                    var arr = params.value;
                                    var content = "<table>";
                                    for (var i = 0; i < arr.length; i++) {
                                        content += "<tr><td style='text-align:right;'>" + keyArr[i] + "</td><td> ： </td><td>" + arr[i] + "%</td></tr>";
                                    }
                                    content += "</table>";
                                    return content;
                                },
                                textStyle: {color: '#fff',fontSize:text_size},
                            },
                            legend: {
                                data: [title],
                               // orient: 'vertical',      // 布局方式，默认为水平布局，可选为'horizontal' ¦ 'vertical'
                                x: 'center',               // 水平安放位置，默认为全图居中，可选为：'center' ¦ 'left' ¦ 'right' ¦ {number}（x坐标，单位px）
                                y: 'bottom',     
                               // itemWidth:text_size*4,  
                                //itemHeight:text_size*1.2, // 垂直安放位置，默认为全图顶端，可选为：'top' ¦ 'bottom' ¦ 'center' ¦ {number}（y坐标，单位px）
                                textStyle: {
                                    color: '#fff',
                                    //fontSize:text_size
                                }
                            },
                            radar: [
                                        {
                                            indicator: function () {
                                                var indicator = [];
                                                for (var i = 0; i < keyArr.length; i++) {
                                                    var item = {
                                                        text: keyArr[i],
                                                        max: 100 //设置最大值  
                                                    };
                                                    indicator.push(item);
                                                };
                                                return indicator;
                                            }(),
                                            center: ['50%', '50%'],
                                            radius: isAnd,
                                            triggerEvent: true,
                                            name: {
                                                formatter: '{value}',
                                                textStyle: {
                                                    color: '#fff',
                                                    fontSize:text_size*1.3
                                                }
                                            }
                                        }
                                    ],
                            series: [
                                        {
                                            name: '雷达图',
                                            type: 'radar',
                                             itemStyle: {
                                            normal: {
                                                areaStyle: {
                                                    type: 'default'
                                                   },
                                                   color : 'rgba(8, 202, 201,1)'
                                                    }
                                                  },
                                            data: [
                                                {
                                                    value: optionArr,
                                                    name: title,
                                                    areaStyle: {
                                                        normal: {
                                                            opacity: .94,
                                                            color: new echarts.graphic.RadialGradient(0.5, 0.5, 1, [
                                                                {
                                                                    color: 'rgb(8, 202, 201)',
                                                                    offset: 0
                                                                },
                                                                {
                                                                    color: 'rgb(8, 202, 201)',
                                                                    offset: 1
                                                                }
                                                            ])
                                                        }
                                                    },
                                                    label: {
                                                        normal: {
                                                            show: true,
                                                            formatter: function (params) {
                                                                return params.value + "%";
                                                            },
                                                            textStyle: {
                                                                color: '#fff',
                                                                fontSize:text_size
                                                            }
                                                        }
                                                    }
                                                }
                                            ]
                                        }
                                    ]
                            };
                           
                             myChart1.setOption(option1);
                             myChart1.on('click', function (params) {
                                 
                                if (params.componentType == "radar") {
                                    var taskType = params.name;
                                   // taskType = taskType.substr(1, taskType.length - 2);
                                    //console.log(keyArr);
                                    console.log(taskType);
                                    var taskindex = keyArr.indexOf(taskType);
                                    console.log(taskindex);
                                    var taskValue = optionArr[taskindex];
                                    var anshi=Number(taskValue);
                                    var yanwu=100-Number(anshi);
                                    hatchChart_1(anshi,yanwu,taskType);
                                    rewu(taskType)
                                    getVisualTask(taskType);
                                    appcan.window.openToast("正在切换,请稍等...",-1,5,1);
                                    $("#now_rw").text(taskType);
                                   /* myChart1.setOption({
                                      radar: [
                                        {
                                            name: {
                                                textStyle: {
                                                    color: '#fff'
                                                }
                                            }
                                        }
                                    ],
                                  })*/
                                     // params.event.target.style.fill="red";
                                    console.log( params.event.target.style.fill)
                                    console.log(params.event);
                                }
                            }); 
                  },error:function(err){
                      console.log(err);
                  }
              })
          }
          function listTime(){
              if($("#timeList").css("display")=="none"){
                   $("#timeList").show();
              }else{
                   $("#timeList").hide();
              }
          }
          function shuaxin(id){
               IC.talkingDataCount("运行品质","0208");  
             appcan.window.openToast("正在切换,请稍等...",-1,5,1);
              var data1=GetDateStr(-7);
              console.log(data1);
              if(id=="data1"){
                  var dataName=CreateDate.replace(/\-/g,"/");
                  getVisualTaskQuality(CreateDate,CreateDate,dataName);
                  localStorage.setItem("yddf_yxpz_time","1");
              }else if(id=="data2"){
                   var dataName=data1.replace(/\-/g,"/")+"-"+CreateDate.replace(/\-/g,"/");
                  getVisualTaskQuality(data1,CreateDate,dataName);
                  localStorage.setItem("yddf_yxpz_time","2");
              }else if(id=="data3"){
                   var dataName=datemos;
                  getVisualTaskQuality(CreateDate1,CreateDate,dataName);
                  localStorage.setItem("yddf_yxpz_time","3");
              }
              $("#timeList").hide();
          }
          
          function GetDateStr(AddDayCount) {
            var dd = new Date();
            dd.setDate(dd.getDate()+AddDayCount);//获取AddDayCount天后的日期
            var y = dd.getFullYear();
            var m = (dd.getMonth()+1)<10?"0"+(dd.getMonth()+1):(dd.getMonth()+1);//获取当前月份的日期，不足10补0
            var d = dd.getDate()<10?"0"+dd.getDate():dd.getDate(); //获取当前几号，不足10补0
            return y+"-"+m+"-"+d;
        }
        
        function myFunction(dt) {
             IC.talkingDataCount("运行品质","0208");  
            var d = new Date(dt);
            var datestr;
            switch (d.getDay()) {
                case 0:
                    datestr = getPreviousWeek(d, -13, -7);
                    break;
                case 1:
                    datestr = getPreviousWeek(d, -7, -1);
                    break;
                case 2:
                    datestr = getPreviousWeek(d, -8, -2);
                    break;
                case 3:
                    datestr = getPreviousWeek(d, -9, -3);
                    break;
                case 4:
                    datestr = getPreviousWeek(d, -10, -4);
                    break;
                case 5:
                    datestr = getPreviousWeek(d, -11, -5);
                    break;
                case 6:
                    datestr = getPreviousWeek(d, -12, -6);
                    break;
                default:
                    break;
            }
            return datestr;
        }

//获取上一周的起止日期
function getPreviousWeek(date, startadd, endadd) {
    var dateStr;
 IC.talkingDataCount("运行品质","0208");  
    var startYear = addDate(date, startadd).getFullYear();
    var startMonth = addDate(date, startadd).getMonth() + 1;
    var startdate = addDate(date, startadd).getDate();
    var endYear = addDate(date, endadd).getFullYear();
    var endMonth = addDate(date, endadd).getMonth() + 1;
    var endDate = addDate(date, endadd).getDate();
    dateStr = startYear + "/" + startMonth + "/" + startdate + "-" + endYear + "/" + endMonth + "/" + endDate;

    return dateStr;
}
//当前日期加减天数
function addDate(dd, dadd) {
     IC.talkingDataCount("运行品质","0208");  
    var a = new Date(dd)
    a = a.valueOf()
    a = a + dadd * 24 * 60 * 60 * 1000
    a = new Date(a)
    return a;
}

//获取当前月的开始日期
function getMonthStartDate(dt) {
     IC.talkingDataCount("运行品质","0208");  
    var d = new Date(dt);
    return new Date(d.setDate(1)).Format("yyyy-MM-dd 00:00:00");
}

 function hatchChart_1(a,c,name) {
      IC.talkingDataCount("运行品质","0208");  
            Highcharts.setOptions({
                colors: ['#F8E819', '#338FD8', '#7DC754']
             });
              $('#main2').highcharts({ 
                   chart: {
                            type: 'pie',
                            backgroundColor: '#202a33'
                        },
                    title: {
                        text: name+'任务执行情况',
                        x:0, //center,
                        style: {
                            color: '#fff',//颜色
                            fontSize:"13px"  //字体
                            }
                        
                    },
                    tooltip: {
                        //valueSuffix: '人次'
                        style: {     
                              fontSize:text_size, 
                                 color :'#000',
                            } ,
                            useHTML: true,
                            headerFormat: '<small style="font-size:12px">{point.key}</small><table>',
                            pointFormat: '<tr><td style="color: {series.color}">{series.name}: </td>' +
                                '<td style="text-align: right"><b>{point.y} %</b></td></tr>',
                            footerFormat: '</table>',
                            valueDecimals: 2
                    },
                    credits:{
                               enabled:false
                           },
                      plotOptions: {
                            pie: {
                                size:'230',
                                innerSize:'0',
                                cursor: 'pointer',
                                allowPointSelect: true,
                                cursor: 'pointer',
                                dataLabels: {
                                    enabled: true,
                                    format: '{point.name}',
                                    style: {     fontSize:text_size,    color : '#fff'  }
                                },
                                showInLegend: true
                            }
                        }, 
                         colors:[
                        'rgba(198, 202, 205,1)','rgba(8, 202, 201,1)'
                       
                      ],
                      legend:{
                         itemStyle:{color:'#fff'},
                         itemWidth:100
                      },
                       series: [{ 
                        type: 'pie',
                        name: '百分比',
                        data: [
                            ['延误',c],
                            {
                                name: '按时',
                                y: a,
                                sliced: false,
                                selected: true,
                                color:"rgba(8, 202, 201,1)"
                            },
                        ]
                    }]
                });
            }
            //getVisualTask('接机')
            function getVisualTask(name){
                 IC.talkingDataCount("运行品质","0208");  
                  var data1=GetDateStr(-7);
               console.log(data1)
               var id= localStorage.getItem("yddf_yxpz_time");
              console.log(data1);
              var date1,date2;
              if(id=="1"){
                 // var dataName=CreateDate.replace(/\-/g,"/");
                 date1=CreateDate;
                 date2=CreateDate;
                 // getVisualTaskQuality(CreateDate,CreateDate,dataName);
                 // localStorage.setItem("yddf_yxpz_time","1");
              }else if(id=="2"){
                 date1=data1;
                 date2=CreateDate;
                 //var dataName=data1.replace(/\-/g,"/")+"-"+CreateDate.replace(/\-/g,"/");
                 // getVisualTaskQuality(data1,CreateDate,dataName);
                 // localStorage.setItem("yddf_yxpz_time","2");
              }else if(id=="3"){
                  date1=CreateDate1;
                  date2=CreateDate;
                 //var dataName=datemos;
                 //getVisualTaskQuality(CreateDate1,CreateDate,dataName);
                 //localStorage.setItem("yddf_yxpz_time","3");
              }
               var code=$("#code").html();
              if(code=="上海虹桥"){
                  code="SHA";
              }else{
                  code="PVG";
              }
                var url=t_url+"mpservice/yxpz_getVisualFlightTypeQuality.action?periodStart="+date1+"&periodEnd="+date2+"&siteName="+code+"&taskType="+name;
                console.log(url);
                $.ajax({
                    url:url,
                    type:"GET",
                    dataType:"text",
                    success:function(data){
                         appcan.window.closeToast();
                        console.log(JSON.stringify(data));
                        var json=data;
                        console.log(typeof(json));
                        json=eval("("+json+")");
                        json=json.table1;
                        console.log(json);
                        var arr_1=[];
                        var arr_2=[];
                        for(i=0;i<json.length;i++){
                            arr_1.push(json[i].EQUIPMENT);
                            arr_2.push(Number(json[i].AVGACTCONTINUEOFFSET));
                        }
                        console.log(arr_1);
                        console.log(arr_2);
                        option3= {
                           title: {
                                text: name+'机型平均用时情况分析',
                                x:'center',
                                y:"top",
                                textStyle: {color: '#fff',fontSize:text_size}
                            },
                            tooltip : {
                                trigger: 'axis'
                            },
                            legend: {
                                orient: 'vertical', 
                                //show:true,
                                data:['机型平均耗时'],
                                x:'center',
                                y:'bottom',
                               // itemWidth:text_size*4,  
                               // itemHeight:text_size*1.2, 
                                textStyle: {
                                    color: '#fff',
                                   // fontSize:text_size
                                },
                                
                            },
                            toolbox: {
                                show : true,
                                feature : {
                                    mark : {show: true},
                                    //dataView : {show: true, readOnly: false},
                                   // magicType: {show: true, type: ['line', 'bar']},
                                   // restore : {show: true},
                                   // saveAsImage : {show: true}
                                }
                            },
                            calculable : true,
                            xAxis : 
                                {   
                                   splitLine:{
                                        show:false
                                    },
                                    type : 'value',
                                    boundaryGap : [0, .5],
                                    axisLabel:{
                                        textStyle: {
                                            color: '#fff',
                                            fontSize:text_size
                                        }
                                    },
                                    axisLine: {
                                    lineStyle: {
                                        type: 'solid',
                                        color: '#ccc',//左边线的颜色
                                        width:'2'//坐标线的宽度
                                    }
                                },
                                },
                            yAxis : 
                                {   
                                    splitLine:{
                                        show:false
                                    },
                                    axisTick:{
                                      show:false
                                    },
                                    axisLabel:{
                                        textStyle: {
                                            color: '#fff',
                                            fontSize:text_size
                                        }
                                    },
                                    type : 'category',
                                    data : arr_1,
                                    axisLine: {
                                    lineStyle: {
                                        type: 'solid',
                                        color: '#ccc',//左边线的颜色
                                        width:'2'//坐标线的宽度
                                    }
                                },
                                } ,
                            series : 
                                {   
                                    itemStyle: {
                                        normal: {
                                            //以下为是否显示，显示位置和显示格式的设置了
                                            label: {
                                                show: true,
                                                position: 'top',
                                                formatter: '{b}\n{c}',
                                                fontSize:100
                                            },
                                            labelLine: {
                                                show: true
                                            }
                                        }
                                    },   
                                    barWidth:text_size,
                                    name:'机型平均耗时',
                                    type:'bar',
                                    data:arr_2,
                                    itemStyle:{
                                       normal:{color:'rgba(1, 255, 253,1)'}
                                    },
                                    markLine: {
                                            data: [{
                                                type: 'average', 
                                                name: '平均值',
                                                fontSize:text_size
                                             }],
                                    }
                                }
                        };
                        myChart3.setOption(option3);
                    },error:function(err){
                        console.log(JSON.stringify(err));
                    }
                })
            }
           
            function rewu(name){
                 IC.talkingDataCount("运行品质","0208");  
                 var data1=GetDateStr(-7);
               console.log(data1)
               var id= localStorage.getItem("yddf_yxpz_time");
              console.log(data1);
              var date1,date2;
              if(id=="1"){
                 // var dataName=CreateDate.replace(/\-/g,"/");
                 date1=CreateDate;
                 date2=CreateDate;
                 // getVisualTaskQuality(CreateDate,CreateDate,dataName);
                 // localStorage.setItem("yddf_yxpz_time","1");
              }else if(id=="2"){
                 date1=data1;
                 date2=CreateDate;
                 //var dataName=data1.replace(/\-/g,"/")+"-"+CreateDate.replace(/\-/g,"/");
                 // getVisualTaskQuality(data1,CreateDate,dataName);
                 // localStorage.setItem("yddf_yxpz_time","2");
              }else if(id=="3"){
                  date1=CreateDate1;
                  date2=CreateDate;
                 //var dataName=datemos;
                 //getVisualTaskQuality(CreateDate1,CreateDate,dataName);
                 //localStorage.setItem("yddf_yxpz_time","3");
              }
               var code=$("#code").html();
              if(code=="上海虹桥"){
                  code="SHA";
              }else{
                  code="PVG";
              }
                var url=t_url+"mpservice/yxpz_getVisualTaskTypeQuality.action?periodStart="+date1+"&periodEnd="+date2+"&siteName="+code+"&taskType="+name;
                $.ajax({
                    url:url,
                    dataType:"text",
                    type:"GET",
                    success:function(data){
                        console.log(JSON.stringify(data));
                        console.log(typeof(data));
                        data=eval("("+data+")");
                        var add='';
                        add+='<div id="" style="width:49.5%;text-align:center;line-height: 2.5em;" >';
                        for(i=0;i<data.table1.length;i++){
                                      add+='<div id="" style="width:100%;border-right:  1px solid #08cac9;">'+
                                            data.table1[i].TASKNAME+
                                        '</div>';
                        }
                        add+='</div><div id="" style="width:49.5%;text-align:center;line-height: 2.5em;" >';
                                        for(j=0;j<data.table1.length;j++){
                                            add+= '<div id="" style="width:100%;">'+
                                            Number(data.table1[j].AVGNUMBER)+
                                        '</div>'
                                        }
                                   add+= '</div>';
                        $("#adds").html(add);
                    },error:function(err){
                        console.log(err);
                    }
                })
            }
            //http://172.31.3.190:8080/mpservice/yxpz_getVisualTaskTypeQuality.action?periodStart=2017-05-01&periodEnd=2017-05-01&siteName=SHA&taskType=接机
            //http://172.31.3.190:8080/mpservice/yxpz_getVisualFlightTypeQuality.action?periodStart=2017-05-01&periodEnd=2017-05-01&siteName=SHA&taskType=接机
    </script>
</html>
